import { lazy } from "react";
let Home=lazy(()=>import('../page/home/Index'))
let Order=lazy(()=>import('../page/order/Index'))
let Message=lazy(()=>import('../page/message/Index'))
let Detail=lazy(()=>import('../page/detail/Index'))
let List=lazy(()=>import('../page/list/Index'))
let My=lazy(()=>import('../page/my/Index'))
let Index=lazy(()=>import('../page/index/Index'))
let Pay=lazy(()=>import('../page/pay/Index'))
import { Navigate } from "react-router-dom";
import {
  AppOutline,
  MessageOutline,
  MessageFill,
  UnorderedListOutline,
  UserOutline,
} from "antd-mobile-icons";

export const housrouters = [
  {
    path: "/home",
    element: <Home></Home>,
    title: "首页",
    icon: <AppOutline></AppOutline>,
  },
  {
    path: "/order",
    element: <Order></Order>,
    title: "订单",
    icon: <UnorderedListOutline></UnorderedListOutline>,
  },
  {
    path: "/message",
    element: <Message></Message>,
    title: "消息",
    icon: <MessageOutline></MessageOutline>,
  },
  {
    path: "/my",
    element: <My></My>,
    title: "我的",
    icon: <UserOutline></UserOutline>,
  },
];
export const routes =[
  {
    path: "/",
    element: <Index></Index>,
    children: [
      ...housrouters,
      {
        path: "/",
        element: <Navigate to="/home"></Navigate>,
      },
    ],
  },
  {
    path: "/detail",
    element: <Detail></Detail>,
  },
  {
    path: "/list",
    element: <List></List>,
  },
  {
    path: "/pay",
    element: <Pay></Pay>,
  },
];
export default routes;
